%This file creates the data for Figure 5a and saves it in
%\Replication_files\mat_files\fig4c_data.mat

clear
cd ../mat_files
% psi = 1/epsilon so epsilon=[0.5,5] implies psi = [0.2,2]
for psi=0.2:0.05:2
    cd ../m_files
    set_parameters(2.48,0,1.51,-.52,0.8,15,1,0,8,4,20,psi);
    cd ../mod_files
    dynare a15_markups_extended.mod
    corr_w_inertia=zeros(17,1);
    for i=-8:1:8
        corr_w_inertia(i+9)=corr(mu(9+i:9992+i),y(9:9992)); 
    end
    cd ../mat_files
    if psi==0.2
        correlations=corr_w_inertia;
    else
        load('fig4c_data.mat');
        correlations=[correlations corr_w_inertia];
    end
    save('fig4c_data.mat','correlations');
end

cd ../m_files
